<?php  
/* 
Template Name: Page Lien He
*/
?>
<?php get_header(); ?>
<script type="text/javascript">
   $(document).ready(function(){
	$("#contactform").validate({
   		messages: {
			contactname: "*",
			email: {
				email:"*",
				required: "*",
			},
			email_con: {
				email:"*",
				required: "*",
				equalTo: "*",
			},
			captcha_image : {
				required : "*",
			}
     	},
		rules: {
			email_con: {
				equalTo: "#email",
			}
		}
	});
});
</script>
<div class="cy-content">
	<?php get_sidebar();?>
    <div class="cy-content-center">
 <div class="cy-center-title"><span>Liên hệ</span></div>
   <div class="cy-center-ct">
    <form method="post" action="<?php bloginfo("template_directory"); ?>/sendmail.php" id="contactform" >      
      <!-- Contact name-->
      <div class="cy-line">
        <label class="cy-line-left" for="contactname"> Tên<span style="color:red">*</span></label>
        <div class="cy-r-line">
          <input type="text" size="40" name="contactname" id="contactname" value="" class="required"/>
        </div>
      </div >
      <!-- Address-->
      <div class="cy-line">
        <label class="cy-line-left" for="address">Ðịa chỉ</label>
        <div class="cy-r-line">
          <input type="text" size="40" name="address" id="address" value=""/>
        </div>
      </div>
      <!-- phonenumber-->
      <div class="cy-line">
        <label class="cy-line-left" for="phonenumber">Ðiện thoại</label>
        <div class="cy-r-line">
          <input type="text" size="40" name="phonenumber" id="phonenumber" value=""/>
        </div>
      </div>
      
      <!-- Email-->
      <div class="cy-line">
        <label class="cy-line-left" for="email">Email<span style="color:red">*</span></label>
        <div class="cy-r-line">
          <input type="text" size="40" name="email" id="email" value="" class="required email" />
        </div>
      </div>
      <!-- Message-->
      <div class="cy-line">
        <label style="height:142px;" class="cy-line-left" for="message">Tin nhắn</label>
        <div class="cy-r-line">
          <textarea rows="7" cols="40" name="message" id="message" ></textarea>
        </div>
      </div>
      <!-- Captcha-->
      <div class="cy-line">
        <label style="height:68px;" class="cy-line-left"  for="message">Captcha</label>
        <a href='javascript: refreshCaptcha();'> <img src="<?php bloginfo("template_directory");?>/captcha_code_file.php?rand=<?php echo rand(); ?>" id='captchaimg' ></a><br />
        <div class="cy-r-line">
          <input style="margin:0px;" size="40" id="captcha_image" name="captcha_image" type="text" class="required captcha_image">
        </div>
      </div>
      <script language='JavaScript' type='text/javascript'>
           function refreshCaptcha()
             {
               var img = document.images['captchaimg'];
               img.src = img.src.substring(0,img.src.lastIndexOf("?"))+"?rand="+Math.random()*1000;
             }
           </script>
      <input class="btn" type="submit" value="Gởi" name="submit"  src="<?php bloginfo("template_directory");?>/_img/send-button.png" width="77px" height="23px"/>
      <input class="a" type="hidden" value="rad" />
    </form>
    
  </div><!--cy-center-ct-->
	 </div><!--cy-content-center--> 
     </div><!--cy-content--> 
<?php get_footer(); ?>